[native] Enable node pool type specification when reporting to the coordinator from a C++ worker #24569
Conversation
|
New release note guidelines. Please remove the manual PR link in the following format from the release note entries for this PR. I have updated the Release Notes Guidelines to remove the examples of manually adding the PR link. |
|
@jaystarshot : Is the node pool type an optimization or it affects functionality as well ? So if a non-leaf worker received a TableScan would it throw error ? |
|
@aditi-pandit The coordinator won’t send a non leaf fragment. If it does i believe the execution should be normal since there is no blocking logic in the worker. |
|
@majetideepak can you please take a look |
| address_ = fmt::format("[{}]", address_); | ||
| } | ||
| nodeLocation_ = nodeConfig->nodeLocation(); | ||
| nodePoolType_ = systemConfig->poolType(); |
There was a problem hiding this comment.
What are the possible values for pool Type ? Might be good to validate the value.
There was a problem hiding this comment.
The accepted values are here Sure I can add that
| return requiredProperty(std::string(kPrestoVersion)); | ||
| } | ||
|
|
||
| std::string SystemConfig::poolType() const { |
There was a problem hiding this comment.
Wanted to confirm that this is not a registered property... Else it has to be a part of registeredProps_. If you add it to registeredProps_ it might be simpler to initialize the default value as well.
There was a problem hiding this comment.
What is the difference between registeredProps_ and configs?
There was a problem hiding this comment.
Registered properties are validated on server startup https://github.com/prestodb/presto/blob/master/presto-native-execution/presto_cpp/main/common/Configs.cpp#L110
Might be better to add it to avoid warnings.
aditi-pandit
left a comment
There was a problem hiding this comment.
@jaystarshot : Just had 2 questions else this PR should be fine.
|
@aditi-pandit I am just using the same property name as presto java uses. Its defined in serverconfig here. |
Thanks @jaystarshot for the explanation. I saw the linked PR later. Yeah, we'll have to stick with this name. |
7088f2f to
bc3388d
Compare
|
@pdabre12 @pramodsatya : Can you'll take a look at the failures in prestocpp-linux-build-and-unit-test / prestocpp-linux-presto-sidecar-tests (pull_request) |
|
Suggest rephrasing of release note entry to follow the Order of changes, and Order of sections grouping in the Release Notes Guidelines: |
aditi-pandit
left a comment
There was a problem hiding this comment.
@jaystarshot : Have one major comment about the required vs optional. The rest are nits.
Another thing : Please change your commit to add a prefix of [native]
|
|
||
| std::string SystemConfig::poolType() const { | ||
| static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; | ||
| auto value = requiredProperty(std::string(kPoolType)); |
There was a problem hiding this comment.
Should this be optionalProperty instead ? Configs which don't have pool-type will cause failures post this change. So this could be very disruptive. Could that be the reason for all the test failures ? I haven't looked at the details but the timeouts most likely could be because the workers didn't start up.
There was a problem hiding this comment.
i thought the default will always be initialized when we put this in the registeredProps_ map i can try with optional
| } | ||
|
|
||
| std::string SystemConfig::poolType() const { | ||
| static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; |
There was a problem hiding this comment.
Nit rename variable to kPoolTypes.
Constant variable names should be prefixed with 'k'
| const bool sidecar, | ||
| const std::vector<std::string>& connectorIds, | ||
| const uint64_t maxFrequencyMs_, | ||
| const std::string& nodePoolType, |
There was a problem hiding this comment.
We could move this parameter higher up since there aren't any optional parameters in this method. After nodeLocation or sidecar ?
bc3388d to
fe3a38b
Compare
aditi-pandit
left a comment
There was a problem hiding this comment.
@jaystarshot : Please change your commit title to have prefix [native] as well.
One minor nit otherwise.
| } | ||
|
|
||
| std::string SystemConfig::poolType() const { | ||
| static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; |
There was a problem hiding this comment.
Nit: Rename this set of constants with k Prefix as well. kPoolTypes maybe
fe3a38b to
4573986
Compare
aditi-pandit
left a comment
There was a problem hiding this comment.
Thanks for the iterations @jaystarshot
4573986 to
38b72d5
Compare
38b72d5 to
77690d6
Compare
aditi-pandit
left a comment
There was a problem hiding this comment.
Thanks for the test change @jaystarshot
Description
Presto supports splitting workers into leaf and non leaf pools. This was added here.
For this the coordinator needs
worker-isolation-enabled=trueand workers can report their pool_type to the resource manager.Adding the same configs in presto c++ so that the announcer can report the node type.
With this (since support was already added in coordinator) one can deploy any combination of native/java workers in LEAF/INTERMEDIATE etc.
Motivation and Context
Impact
Test Plan
Tested that setting works and if we set pool_type=LEAF in presto c++ the coordinator will only schedule leaf tasks there
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.